/*
 * @Descripttion:
 * @Author: jhw
 * @Date: 2023-05-31 10:45:21
 * @LastEditors: jhw
 * @LastEditTime: 2023-05-31 15:02:41
 */
import { initGlobalState } from 'qiankun';

const initialState = {
  // 这里写初始化数据
  name: '初始哈',
};

// 初始化 state
const actions = initGlobalState(initialState);
actions.onGlobalStateChange((state, prev) => {
  // 监听公共状态的变化
  console.log('主应用: 变更前');
  console.log(prev);
  console.log('主应用: 变更后');
  console.log(state);
});

export default actions;

// <!-- <el-button @click="handleTest()">测试哦</el-button> -->

// import actions from '@/modules/actions.js';

// handleTest() {
//   actions.setGlobalState({
//     name: 'test',
//   });
// },
